#include <iostream>
#include <stdio.h>
using namespace std;
typedef long long LL;
const int MAXN = 500007;
const LL MOD = 998244353;
int Fac[MAXN];
int RFac[MAXN];
int Kuai(LL a, LL k) {
    LL ret = 1;
    while (k) {
        if (k&1) {
            ret = (ret * a) % MOD;
        }
        k = (k >> 1);
        a = (a * a) % MOD;
    }
    return ret;
}
void Init() {
    Fac[0] = 1;
    for (int i=1; i<MAXN; ++i) {
        Fac[i] = (1ll * Fac[i-1] * i) % MOD;
    }
    RFac[MAXN-1] = Kuai(Fac[MAXN-1], MOD-2);
    for (int i=MAXN-1; i>0; --i) {
        RFac[i-1] = (1ll * RFac[i] * i) % MOD;
    }
}
int C(LL n, LL k) {
    return 1ll * Fac[n] * RFac[k] % MOD * RFac[n-k] % MOD;
}
int solve(LL n, LL m, LL k) {
    LL ret = C(k+m-1, m-1);
    int len = min(k/n, m);
    int ans = 0;
    for (int i=1; i<=len; ++i) {
        if (i&1) {
            ans = (ans + 1ll*C(k-i*n+m-1, m-1)*C(m, i)%MOD) % MOD;
        }
        else {
            ans = (ans - 1ll*C(k-i*n+m-1, m-1)*C(m, i)%MOD + MOD) % MOD;
        }
    }
    ret = (1ll * ret - ans + MOD) % MOD;
    return ret;
}


int main() {
#ifdef hai
    freopen("in.txt", "r", stdin);
#endif
    Init();
    int T, n, m, k;
    cin>>T;
    while (T--) {
        scanf("%d %d %d", &n, &m, &k);
        printf("%d\n", solve(n, m, k));
    }
    return 0;
}
